<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>我的购物车-小米商场</title>
		<link rel="shortcut icon" href="img/favicon.ico" />
		<link rel="stylesheet" type="text/css" href="css/shoppingcar.css" />
		<style type="text/css">
			/* 头像 */
			.thumFace{
				width: 28px;
			    height: 28px;
			    border-radius: 14px;
			    vertical-align: -8px;
			    margin-right: 15px;
			}
		</style>
	</head>

	<body>
		<div class="site-header site-mini-header">
			<div class="container">
				<div class="header-logo">
					<a class="logo ir" href="index.jsp" title="小米官网">
                       ::before
						小米官网
						::after
					</a>
				</div>
				<div class="header-title" id="J_miniHeaderTitle">
					<h2>我的购物车</h2>
				</div>
				<div class="topbar-info" id="J_userInfo">
				<%
					String loginImg = (String) session.getAttribute("simg");
				 	if (loginImg != null) {
				 		String user = session.getAttribute("simg").toString();
				 		out.print("<img class = 'thumFace' src='"+loginImg+"'>");
				 	} 
				%>
				<%
					String loginName = (String) session.getAttribute("sname");
					String loginTel = (String) session.getAttribute("stel");
					if (loginName != null) {
						// 用户已登录
						String user = session.getAttribute("sname").toString();
						out.print("<a href = 'userinfo.jsp' id = 'userInfo'>" + user + "<a/>");
						out.print("<span> |</span> ");
						out.print("<a href='logout.jsp'>退出</a> ");
					} else if (loginTel != null) {
						// 用户已登录
						String user = session.getAttribute("stel").toString();
						out.print("<a href = 'userinfo.jsp' id = 'userInfo'>" + user + "<a/>");
						out.print("<span>|</span> ");
						out.print("<a href='logout.jsp'>退出</a> ");
					} else {
						// 用户未登录
						out.print("<a href='loading.jsp' id = 'userName'>登录</a>");
						out.print("<span>|</span> ");
						out.print("<a href='register.jsp'>注册</a> ");
					}
				%>
				</div>
			</div>
		</div>
		<div class="page-main">
			<div class="container">
				<div class="cart-empty cart-empty-nologin" id="J_cartEmpty">
					<h2>您的购物车还是空的！</h2>
					<p class="login-desc">登录后将显示您之前加入的商品</p>
					<a href="loading.jsp" class="btn btn-primary btn-login">
						立即登录
					</a>
					<a href="index.jsp" class="btn btn-primary btn-shoping J_goShoping">
						马上去购物
					</a>
				</div>
			</div>
		</div>
	</body>

</html>